#ifndef __LIST_EXCEPTION_H__
#define __LIST_EXCEPTION_H__

#include <exception>

namespace cs236703_spring2012_hw2
{

// The ListException class is the base of all list
// exceptions - every list related exception should subclass it.
// An alternative would be to have only one class, 
// with an error code variable inside. But that is not the OOP way...
class ListException :
	public std::exception
{
};

// Indicates an immutable node is being modified.
class ImmutableModificationException :
	public ListException
{
};

// Indicates an existing iterator is trying to move or
// change the value of a node after another iterator 
// has changed the structure of the list (added or removed nodes).
class ConcurrentModificationException :
	public ListException
{
};

// Indicates an iterator is moved to a non-existant node
// (by calling Next() when HasNext() would return false).
// Should also be thrown when calling AddBefore() or AddAfter()
// on an empty list (List.AddToFront or Back should be used to create
// the first nodes).
class NoSuchElementException :
	public ListException
{
};

// Indicates an operation is being attempted on an iterator
// that is not pointing on a valid node. For instance,
// it should be thrown when trying to delete a node using
// a newly created iterator, without calling Next() first.
class IllegalStateException :
	public ListException
{
};

}

#endif
